package my.poemhelper.mb;

import my.poemhelper.Facade;
import my.poemhelper.vo.User;

public class UserMB extends BaseMB<User>{

	private User user = new User();
	{
		user.setNickName("admin");
		user.setPassword("admin");
		user.setUserName("admin");
	}
	public String login(){
		User u = Facade.facade.getUser(user.getUserName(), user.getPassword());
		if(u.getId()>0){
			this.getSession().setAttribute("user", u);
			loginResult = "登录成功！！";
		}else{
			loginResult = "登录失败！！";
		}
		return "loginResut";
	}
	
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}

	@Override
	protected String getAddString() {
		return "";
	}
}
